﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BLL
{
    public class BaseBll<T> where T : MODEL.BaseModel, new()
    {
        protected IDAL.IBaseDal<T> dal;
        public BaseBll(string type)
        {
            dal = Factory.DataAccess<IDAL.IBaseDal<T>>.createdal(type);
        }
        public virtual int add(T model)
        {
            return dal.add(model);
        }
        public virtual List<T> show()
        {
            return dal.show();
        }
        public virtual int del(int id)
        {
            return dal.del(id);
        }
        public virtual MODEL.BaseModel updid(int id)
        {
            return dal.updid(id);
        }
        public virtual int upd(T model)
        {
            return dal.upd(model);
        }
    }
}
